package com.infore.operation.mapper;

import com.infore.operation.entity.*;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.ListIterator;
import java.util.Map;

/**
 * @author:wk
 * @date:Created in 17:43 2018\1\22 0022
 */
public interface UserMapper {

    User getLoginUserByAccount(@Param("loginAcc") String loginAcc);

    User getLoginUser(@Param("loginAcc") String loginAcc,@Param("password") String password);

    List<Person> queryLowPson(@Param("opId") Integer opId,@Param("userId") Integer userId,@Param("postId") Integer postId,@Param("branchId") Integer branchId,@Param("roleId") Integer roleId);

    UserInfoId queryUserInfoId(@Param("userId")String userId);

    List<Person> queryHeadPson(@Param("postId")Integer postId,@Param("opId")Integer opId,@Param("branchId")Integer branchId,@Param("brId")Integer brId);

    String queryPsonByStationId(@Param("stationId")Integer stationId);

    List<Person> queryHeadPsonDefault(@Param("brId")Integer brId);

    List<Branch> queryBranchByUserId(@Param("opId")Integer opId,@Param("brId")Integer brId,@Param("branchId")Integer branchId);

    List<OpCenPerson> queryPsonByBranchId(@Param("userId")String userId,@Param("opId")Integer opId,@Param("branchId")Integer branchId,@Param("branch")String branch,@Param("postId")Integer postId);

    Person findByIdAndPassword(@Param("userId")String userId,@Param("password")String password);

    void changePassword(@Param("userId")String userId,@Param("password")String password);

    void saveHeadImage(@Param("picImg")byte[] picImg,@Param("pic")String pic,@Param("userId")String userId);

    void saveGPS(@Param("lnt")String lnt,@Param("lat")String lat,@Param("address") String address,@Param("userId")String userId);

    List<PositionPerson> queryPsonByUserId(@Param("userId")String userId,@Param("opId")Integer opId,@Param("branchId")Integer branchId,@Param("postId")Integer postId,@Param("roleId")Integer roleId,@Param("keyword")String keyword);

    List<PositionPerson> queryNearPson(@Param("postId")Integer postId,@Param("userId")String userId,@Param("opId")Integer opId,@Param("branchId")Integer branchId,
    @Param("minLat")double minLat,@Param("maxLat")double maxLat,@Param("minLng")double minLng,@Param("maxLng")double maxLng,@Param("lnt")String lnt,@Param("lat")String lat);

    UserInfoId verifyCode(@Param("phoneNum")String phoneNum);

    void checkCodeAndChangePassword(@Param("password")String password,@Param("phoneNum")String phoneNum);

    List<FaultLevel> searchBranch(@Param("size")String size,@Param("brId")String brId);
    Map<String,Object>queryUserInfo(@Param("userId")Integer userId);
    
    List<EquipReason> queryReason(@Param("modelId")Integer modelId);
    List<EquipReason> queryReason1(@Param("modelId")Integer modelId,@Param("reason")String reason);
    Integer insertEquipReason(EquipReason reason);
    Integer insertEquipLog(EquipLog log);
    Integer queryPsonCountByUserId(int userId);
    
    List<Equip> queryAllEquip();
    
    void updateAllEquip(List<Equip> list);
    }
